<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
            }

            .col-input {
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }

            function doPopupWindow(obj) {
                var pkid = obj.parentNode.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].innerHTML;
                popupwindow = window.open("custAddInfoAddDetl.xhtml?action=addinfo&amp;pkid=" + pkid, "popupwindow", "height=600,width=800,left=200,top=100,toolbar=no,menubar=no,scrollbars=yes,location=no");
                popupwindow.focus;
            }

        </script>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <p:growl id="msgs" showDetail="false"/>
            <h:form id="form">
                <p:panel header="【客户基本信息】">
                    <p:dataTable id="pdt" style="width:100%;"
                                 value="#{custAddAction.custBaseList}" var="record"
                                 rowKey="#{record.pkid}"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 paginator="true" rows="15" paginatorPosition="bottom"
                                 rowsPerPageTemplate="100,50,30,15,5"
                                 emptyMessage="数据记录为空...">
                        <p:column headerText="Pkid" style="display:none;">
                            <h:outputText style="display: none;" value="#{record.pkid}"/>
                        </p:column>
                        <p:column headerText="客户号" style="text-align:center" sortBy="#{record.custno}">
                            <h:outputText value="#{record.custno}"/>
                        </p:column>
                        <p:column headerText="客户名称" style="text-align:left">
                            <h:outputText value="#{record.custname}"/>
                        </p:column>

                        <p:column headerText="操作" style="text-align:center">
                            <p:commandLink style="color:blue;" value="添加附加信息" update="popupwindow"
                                           onclick="doPopupWindow(this);">
                            </p:commandLink>
                        </p:column>
                    </p:dataTable>
                </p:panel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>